var Cart = {

    cartContainer: 'cart-container',

    successFunction: function(json){
        if(json.message) Main.addMessage(json.message);
        if(json.error) Main.addError(json.error);
        $.fn.yiiGridView.update("cart-table");
    },

    addToCart: function(link,prodId,count){
        var url=$(link).attr('data-id');
        var data='prodId='+prodId+'&count='+count;

        Ajax.sendAjax(url,data,'get',Cart.successFunction);
    },

    removeFromCart: function(link){
        var url=$(link).attr('href');
        var data='remove=1';

        Ajax.sendAjax(url,data,'get',Cart.successFunction);
    }
}